using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ButtonTriggerManager : MonoBehaviour
{
    [SerializeField] private ButtonTrigger[] _buttonTriggers;
    [SerializeField] private Transform[] _spawnTrans;
    [SerializeField] private GameObject[] _weaponScrollPrefab;
    public void ButtonTrigger()
    {
        for (int i = 0; i < _buttonTriggers.Length; i++)
        {
            if (_buttonTriggers[i].IsFinish() == false)
                return;
        }

        for (int i = 0; i < _buttonTriggers.Length; i++)
            _buttonTriggers[i].GetComponent<Collider2D>().enabled = false;
        
        for(int i = 0; i < _weaponScrollPrefab.Length; i++)
        {
            Instantiate(_weaponScrollPrefab[i], _spawnTrans[i].position, Quaternion.identity);
        }
    }
}
